package com.zhenai.rocyuan.modules.leer.service.impl;

import java.util.Date;

import org.springframework.jdbc.core.simple.SimpleJdbcOperations;

import com.zhenai.rocyuan.commons.uitls.SqlCommonUtils;
import com.zhenai.rocyuan.modules.leer.service.LeerService;

public class LeerServiceImpl  implements LeerService{
	
	SimpleJdbcOperations leerJdbc;
	
	public void sendLeer(Integer memberId,Integer objectId,int contentId){
		String tableName = SqlCommonUtils.getMod1000SubTableName("Leer",
				memberId.longValue());
		String sql = "insert into " + tableName + "(memberid,senderid,ReceiverId,leer_date,orderDate,sendContentId)values(?,?,?,now(),now(),?) ";
		
		
		String  tableName1 = SqlCommonUtils.getMod1000SubTableName("Leer",
				objectId.longValue());
		String  sql1 = "insert into " + tableName1 + "(memberid,senderid,ReceiverId,leer_date,sendContentId)values(?,?,?,now(),now(),?) ";
		
		leerJdbc.update(sql, memberId, memberId, objectId,contentId );
		leerJdbc.update(sql1, objectId, memberId, objectId, contentId );
	}



}
